Next | Prev | Up | Top | Contents | Index

Unmounting Filesystems

Filesystems are automatically unmounted when the system is shut down. To manually unmount filesystems, use the umount command. The three basic forms of the command are shown in Table 5-1. Local filesystems can be unmounted with either of the first two forms shown in the table; they are equivalent. Similarly, the first and third forms are equivalent for remote filesystems.

Forms of the umount Command
CommandComments
umount mount_point_directory mount_point_directory is a directory pathname that is the mount point for the filesystem. This form can be used for local or remote filesystems.
umount device_file device_file is a block device file name. This form is only for local filesystems.
umount host:directory host:directory is a remote directory. This form is only for remote filesystems.
umount -a Attempt to unmount all the filesystems currently mounted (listed in /etc/mtab) except / and /usr. This command is not the complement of the mount -a command, which mounts all filesystems listed in /etc/fstab.

For example, to unmount a local or remote filesystem mounted at /d2, give this command:

umount /d2 
To unmount the filesystem on the partition /dev/dsk/dks0d1s7, give this command:

umount /dev/dsk/dks0d1s7 
To unmount the remote-mounted (NFS) filesystem depot:/usr/spool/news, give this command:

umount depot:/usr/spool/news 
To be unmounted, a filesystem must not be in use. If it is in use and you try to unmount it, you get a "Resource busy" message. These messages and their solutions are explained in the umount(1M) reference page.


Next | Prev | Up | Top | Contents | Index